package com.likpia.greendaotest;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

public class ViewGenerateUtils {

    public static View generatePieLabelView(Context context, int color, String label, float value) {
        View view = LayoutInflater.from(context).inflate(R.layout.view_pie_tag, null, false);
        view.findViewById(R.id.view_rect).setBackgroundColor(color);
        ((TextView) view.findViewById(R.id.tv_label)).setText(label);
        ((TextView) view.findViewById(R.id.tv_value)).setText(String.valueOf((int) value));
        return view;
    }

}
